<template>
	<div id='app'>
		<el-divider>账号信息</el-divider>
		<div class="box1">

			昵称 &nbsp;<el-input placeholder="" v-model="name" clearable style='width: 400px; padding:20px 0; '>
			</el-input>
		</div>

		<div class="box1">
			姓名 &nbsp;<el-input placeholder="" v-model="username" clearable style='width: 400px;'>
			</el-input>
		</div>

		<div class="box1">
			<span style="margin-left: -20px;"> 手机号</span>
			<el-input placeholder="" v-model="phone" clearable style='width: 400px;padding: 20px 0; padding-top: 20px; margin-left: 10px;'>
			</el-input>
		</div>
		
		<div class="box1">
			<span style="margin-left: -0px;"> 密码</span>
			<el-input placeholder="" v-model="password" clearable style='width: 400px;padding: 20px 0;padding-top: 0px;margin-left: 10px;'>
			</el-input>
		</div>
      
		<div class="box1">
			积分 &nbsp;
			<el-input placeholder="" v-model="count" :disabled="true" style='width: 400px;padding-top: 0px;'>
			</el-input>
		</div>


		<el-divider>学历信息</el-divider>

		<div class="box1">
			学校 &nbsp;<el-input placeholder="马上填写" v-model="xueli" clearable style='width: 400px; padding:20px 0; border: 0px;'>
			</el-input>
		</div>

		<div class="box1">
			<div class="a1" style="margin-left: -30px;">

				毕业时间 &nbsp;<el-input placeholder="马上填写" v-model="endUp" clearable style='width: 400px; padding:0px 0;'>
				</el-input>
			</div>
		</div>
		<el-button @click='baocun()' type="primary" round style='position: absolute; top: 90px; right: 250px;'>保存</el-button>
	</div>
</template>

<script>
	import axios from "axios"
	import store from '../../store/modules/user.js'
	export default {
		data() {
			return {
				us: store.state.user,
				name: store.state.user.name,
				username: store.state.user.username,
				phone: store.state.user.phone,
				count: store.state.user.count,
				password: store.state.user.password,
				xueli: '',
				endUp: ''
			}
		},
		methods: {
			baocun() {
		
				var params = new URLSearchParams();
				params.append('name', this.name);
				params.append('username',this.username);
				params.append('phone',this.phone);
				params.append('password',this.password);
				params.append('id',this.us.id);
				var that=this;
				axios.post('/user/updateUser',params,{
					header:{'Content-type':'application/x-www-form-urlencoded;charset=UTF-8'}
					})
				.then(function(data) {
					that.$router.push({
						path:"/"
					})
					
					
					console.log(data);
				}).catch(function(Error) {
					console.log(Error);
				});
			}
		},
		created() {
			console.log(this.us);
			
		}
	}
</script>

<style scoped>
	#app {
		width: 1200px;
		margin: 0 auto;
	}
</style>
